(function($, doc) {
	$.plusReady(function() {
		mui.init();
		var gpsPoint;
		//var currentWin = plus.webview.currentWebview();
		var title = plus.webview.currentWebview().title;
		var address = plus.webview.currentWebview().address;
		var lng = plus.webview.currentWebview().lng;
		var lat = plus.webview.currentWebview().lat;
		var oft = plus.display.resolutionHeight;
		doc.getElementById("allmap").style.height = oft - 50 + 'px';
		//console.log(address);
		plus.geolocation.getCurrentPosition(translatePoint, function(e) {
			mui.toast("异常:" + e.message);
		});
		function translatePoint(){
			setMap(lng, lat);
		}

		function setMap(currentLon, currentLat) {
			gpsPoint = new BMap.Point(currentLon, currentLat);
			BMap.Convertor.translate(gpsPoint, 2, initMap); //坐标转换
		}


		function initMap(point) {
			map = new BMap.Map("allmap"); //创建地图
			map.addControl(new BMap.NavigationControl());
			map.addControl(new BMap.ScaleControl());
			map.addControl(new BMap.OverviewMapControl());
			//map.centerAndZoom(point, 16);
			map.centerAndZoom(point, 16);
			map.enableScrollWheelZoom(true);
			map.addOverlay(new BMap.Marker(point));
			//map.addEventListener("click", changeAdress);
		}

		

	});
}(mui, document));